<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page isELIgnored="false" %>
<%@ include file="/WEB-INF/views/common/includes.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<title> <fmt:message key="event.website.title"/></title>
		<link href="<c:url value='/static/css/estilo_efqm.css'/>" rel="stylesheet" type="text/css" />
		<link href="<c:url value='/static/css/acordion.css'/>" rel="stylesheet" type="text/css" />
		<link href="<c:url value='/static/css/osx.css'/>" rel="stylesheet" type="text/css" />
		<link type='text/css' href='/static/css/basic.css' rel='stylesheet' media='screen' />

		<!-- IE 6 "fixes" -->
		<!--[if lt IE 7]>
			<link type='text/css' href='/static/css/basic_ie.css' rel='stylesheet' media='screen' />
		<![endif]-->
		<script type="text/javascript" src="<c:url value='/static/js/google_analytics_inc.js'/>"></script>
		<script type="text/javascript" src="<c:url value='/static/js/jquery-1.4.min.js'/>"></script>
		<script type="text/javascript" src="<c:url value='/static/js/ddaccordion.js'/>"></script>
		
		<script type="text/javascript">
			function rememberPassword() {			
				var email = jQuery.trim($("#username").val());
				if(email=='') {
					alert("<fmt:message key='error.email.fail'/>");
					return;
				}
				$.ajax({
   					type: "GET",
   					url: "<c:url value='/participant/remember'/>",
   					data: "email=" + email,
   					success: function(msg){
     					alert(  msg );
   					}
 				});
			}
 		</script>
		
	</head>
	
	<body id="efqm" class="home"> 
	  
	  
		
		
		
	  <div id="global" class="fondo_practices">
		
		<%@ include file="/WEB-INF/views/common/header.jsp" %>
			
		<div id="efqm_content"> 
			<h3 class="upload_practices">
				<fmt:message key="event.website.target"/>
			</h3>	
			<div id="conten_central">
				
				<div class="columna_left">
					<h4><fmt:message key="event.title"/></h4>		
				</div>
				
				<div class="conten_gen_central">
				
				
				<c:choose>
							<c:when test="${not empty user}">
								<p class="welcome"><fmt:message key="user.welcome"/>, <sec:authentication property="principal.username"/></p>
								<p></p>
								
								
								<sec:authorize access="hasRole('ROLE_COMPANY_SUPERVISOR')">
									<p>
										<a href="<c:url value="/dashboard"/>"><fmt:message key="action.plataform.administer"/></a>
									</p>
								</sec:authorize>
								
								<sec:authorize access="hasRole('ROLE_COMPANY')">
								<form action="" method="post">
									<a href="<c:url value='/company/'/>" title="<fmt:message key="action.company.manage.data"/>" class="register">
										<span><fmt:message key="action.company.manage.data"/></span>
									</a>
								</form>
								</sec:authorize>
							</c:when>
							<c:otherwise>
								<%-- this form-login-page form is also used as the
         					form-error-page to ask for a login again.
         				--%>
    					<c:if test="${not empty param.login_error}">
      						<font color="red">
        						<fmt:message key="user.badlogin.advice"/><br/><br/>
        						<fmt:message key="user.badlogin.reason.tag"/>: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>
      						</font>
    					</c:if>
						
						 <form name="login_form" action="<c:url value='j_spring_security_check'/>" method="POST">
							<label for="j_username">
								<fmt:message key="user.login.user"/>:
							</label>
        					<input type='text' id="username" name='j_username' value='<c:if test="${not empty param.login_error}">
        						<c:out value="${SPRING_SECURITY_LAST_USERNAME}"/></c:if>'/>
        					<label for="j_password">
								<fmt:message key="user.login.password"/>:
							</label>
        					<input type='password' id="password" name='j_password'>
							<a href="javascript:rememberPassword();" title='<fmt:message key="action.user.recover.password"/>'>
								<fmt:message key="action.user.recover.password"/>
							</a>
							<input name="submit" type="submit" value="<fmt:message key="action.user.login"/>" />
							
						</form>
							
							</c:otherwise>
						</c:choose>
					
					
				
				</div>
			</div>
			</div>

				
				<%@ include file="/WEB-INF/views/common/footer.jsp" %>
			
	</div>
	</body>
	
</html>
